package com.ycg.vue.modules.user.controller;


import com.ycg.vue.modules.system.Entity.BillEntity;
import com.ycg.vue.modules.user.service.UserBillService;
import com.ycg.vue.result.Result;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Description
 * @Author jink
 * @Date 2024/8/14
 */
@RestController
@RequestMapping("/userBill/")
public class UserBillController {

    @Resource
    private UserBillService userBillService;

    @PostMapping("add")
    public Result add(@RequestBody BillEntity bill) {
        return userBillService.add(bill);
    }

    @GetMapping("select")
    public Result select() {
        return userBillService.select();
    }

    @GetMapping("changeMonth/{month}")
    public Result changeMonth(@PathVariable String month) {
        return userBillService.changeMonth(month);
    }

    @GetMapping("selectDaysForMonth/{month}")
    public Result selectDaysForMonth(@PathVariable String month) {
        return userBillService.selectDaysForMonth(month);
    }

    @PostMapping("situation")
    public Result situation(@RequestParam String day, Integer type) {
        return userBillService.situation(day,type);
    }
}
